package com.ztesoft.report.entity;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.ztesoft.report.base.entity.BaseEntity;
import lombok.Data;

/**
 * <p>
 * 报表信息表
 * </p>
 *
 * @author y3tu
 * @since 2018-06-20
 */
@Data
@TableName("report")
public class Report extends BaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	/**
	 * 报表ID
	 */
	@TableId(value="id", type= IdType.INPUT)
	private Integer id;
	/**
	 * 报表分类id
	 */
	@TableField("category_id")
	private Integer categoryId;
	/**
	 * 数据源ID
	 */
	@TableField("ds_id")
	private Integer dsId;
	/**
	 * 报表名称
	 */
	private String name;
	/**
	 * EXCEL标题
	 */
	@TableField("excel_title")
	private String excelTitle;
	/**
	 * 报表SQL语句
	 */
	@TableField("sql_text")
	private String sqlText;
	/**
	 * 表头配置(JSON格式)
	 */
	private String header;
	/**
	 * 报表列集合元数据(JSON格式)
	 */
	@TableField("meta_columns")
	private String metaColumns;
	/**
	 * 报表数据生成配置,关联report_data表id
	 */
	@TableField("report_data_id")
	private Integer reportDataId;
	/**
	 * 报表上传配置,关联report_update表id
	 */
	@TableField("report_upload_id")
	private Integer reportUploadId;
	/**
	 * 报表配置选项(JSON格式)
	 */
	private String options;
	/**
	 * 00A:启用 00X:禁用
	 */
	private String status;
	/**
	 * 报表节点在其父节点中的顺序
	 */
	private Integer seq;
	/**
	 * 说明备注
	 */
	private String remarks;
	/**
	 * 头部模板
	 */
	@TableField("headTemp")
	private Integer headTemp;
	/**
	 * 尾部模板
	 */
	@TableField("endTemp")
	private Integer endTemp;
	/**
	 * 创建时间
	 */
	@TableField("create_time")
	private Date createTime;
	/**
	 * 修改时间
	 */
	@TableField("update_time")
	private Date updateTime;
	/**
	 * 创建用户
	 */
	@TableField("create_user")
	private String createUser;
	/**
	 * 修改用户
	 */
	@TableField("update_user")
	private String updateUser;

	@TableField("PARAMS")
	private String params;

	@TableField(exist = false)
	private String queryParams;
	//为了返回前台方便包装使用以下2个
	@TableField(exist = false)
	private String categoryName;
	@TableField(exist = false)
	private String datasourceName;

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "Report{" +
				", id=" + id +
				", categoryId=" + categoryId +
				", dsId=" + dsId +
				", name=" + name +
				", sqlText=" + sqlText +
				", header=" + header +
				", metaColumns=" + metaColumns +
				", reportDataId=" + reportDataId +
				", reportUploadId=" + reportUploadId +
				", options=" + options +
				", status=" + status +
				", seq=" + seq +
				", remarks=" + remarks +
				", createTime=" + createTime +
				", updateTime=" + updateTime +
				", createUser=" + createUser +
				", updateUser=" + updateUser +
				"}";
	}
}
